package managers;

import java.awt.Color;
import java.util.HashMap;

import ontology.PartOfSpeech;

public class ColorManager {

	private static  HashMap<String, Color> colorMap;
	
	private static ColorManager instance;
	
	public static ColorManager getInstance(){
		if(instance == null)
			instance = new ColorManager();
		return instance;
	}
	
	private ColorManager(){
		loadColorMap();
	}
	
	//Getter
	private void loadColorMap(){
		colorMap = new HashMap<String, Color>();
		
		// gray
		colorMap.put(PartOfSpeech.CLAUSE.toLowerCase(), new Color(105, 105, 105)); // DARK_GRAY
		
		// green
		colorMap.put(PartOfSpeech.NOUN.toLowerCase(), new Color(127, 255, 212)); // cyan
		colorMap.put(PartOfSpeech.NOUN_PHRASE.toLowerCase(), new Color(60, 179, 113)); // 0, 102, 204
			
		// blue
		colorMap.put(PartOfSpeech.VERB_PHRASE.toLowerCase(), new Color(100, 149, 237)); // ORANGE
		colorMap.put(PartOfSpeech.VERB.toLowerCase(), new Color(216, 191, 216)); // YELLOW
		
		// light coral
		colorMap.put(PartOfSpeech.ADPOSITION.toLowerCase(), new Color(240, 128, 128)); // 255, 222, 173
		
		// pink
		colorMap.put(PartOfSpeech.ADVERB.toLowerCase(), new Color(218, 112, 214)); // 204,204,0
		colorMap.put(PartOfSpeech.ADVERBIAL_PHRASE.toLowerCase(), new Color(255, 105, 180)); // 102,102,0
		
		// orange
		colorMap.put(PartOfSpeech.ADJECTIVE.toLowerCase(), new Color(255,204,229));
		colorMap.put(PartOfSpeech.ADJECTIVE_PHRASE.toLowerCase(), new Color( 255, 127, 80)); // MAGENTA
		
		// light stell blue
		colorMap.put(PartOfSpeech.CONJUCTION.toLowerCase(), new Color(176, 196, 222)); // GREEN
		
		// light green
		colorMap.put(PartOfSpeech.PARTICLE.toLowerCase(), new Color(144, 238, 144)); //violet
		
		// maroon
		colorMap.put(PartOfSpeech.PERIOD, new Color(128, 0, 0)); //255,153,153
	}
	
	public Color getColor(String partOfSpeech){
		return colorMap.get(partOfSpeech.toLowerCase());
	}
}
